import axios from 'axios'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
let instance=axios.create({
  baseURL:'http://localhost:3002',
  timeout:3000
})

instance.interceptors.request.use(config=>{
  NProgress.start()
  // console.log(config);
  return config
})

instance.interceptors.response.use((res)=>{
  NProgress.done()
  // console.log(res);
  return res.data
},(err)=>{
  alert ('出错了')
  throw err
})


export default instance